package com.sccl.dao;

import org.springframework.jdbc.core.support.JdbcDaoSupport;

/**
 * @author 饶爽
 * @time 2019年9月7日 下午6:00:21
 * @version 1.0.0
 * 账户访问数据库实现类
*/
public class AccountDaoImpl extends JdbcDaoSupport implements AccountDao  {

    @Override
    public void increaseMoney(Integer id, Double money) {
        getJdbcTemplate().update("update t_account set money = money+? where id = ? ", money,id);
    }

    @Override
    public void decreaseMoney(Integer id, Double money) {
        getJdbcTemplate().update("update t_account set money = money-? where id = ? ", money,id);
    }
}
